package com.dux.spbtservice.jpa;

import com.dux.spbtservice.domin.User;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepo extends JpaRepository<User,Long> {

    @EntityGraph(value = "user.roles",type = EntityGraph.EntityGraphType.LOAD)
    User findByUsername(String username);

}
